diff --git a/board/w7o/cmd_vpd.c b/board/w7o/cmd_vpd.c
index 3025699..2763a53 100644
--- a/board/w7o/cmd_vpd.c
+++ b/board/w7o/cmd_vpd.c
@@ -57,4 +57,11 @@
 	return 1;
 }
 
+cmd_tbl_t U_BOOT_CMD(vpd) = MK_CMD_ENTRY(
+	  "vpd",	2,	1,	do_vpd,
+	  "vpd     - Read Vital Product Data\n",
+	  "[dev_addr]\n"
+	  "        - Read VPD Data from default address, or device address 'dev_addr'.\n"
+);
+
 #endif /* (CONFIG_COMMANDS & CFG_CMD_BSP) */
diff --git a/board/w7o/config.mk b/board/w7o/config.mk
index c73329e..bc341ca 100644
--- a/board/w7o/config.mk
+++ b/board/w7o/config.mk
@@ -29,4 +29,3 @@
 TEXT_BASE = 0xFFFC0000
 
 #PLATFORM_CPPFLAGS += -I$(TOPDIR)/board/$(BOARD)
-
diff --git a/board/w7o/errors.h b/board/w7o/errors.h
index d1e5caf..05b4eae 100644
--- a/board/w7o/errors.h
+++ b/board/w7o/errors.h
@@ -95,4 +95,3 @@
 (13) SDRAM address shorted or unconnected, check sdram caps
 */
 #endif /* _ERRORS_H_ */
-
diff --git a/board/w7o/flash.c b/board/w7o/flash.c
index 5651e1c..d6ea635 100644
--- a/board/w7o/flash.c
+++ b/board/w7o/flash.c
@@ -50,21 +50,21 @@
 
     /* Init: no FLASHes known */
     for (i = 0; i < CFG_MAX_FLASH_BANKS; ++i) {
-        flash_info[i].flash_id = FLASH_UNKNOWN;
+	flash_info[i].flash_id = FLASH_UNKNOWN;
     }
 
     /* Get Size of Boot and Main Flashes */
     size_b0 = flash_get_size((vu_long *)FLASH_BASE0_PRELIM, &flash_info[0]);
     if (flash_info[0].flash_id == FLASH_UNKNOWN) {
-        printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
-            size_b0, size_b0<<20);
-        return 0;
+	printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
+	    size_b0, size_b0<<20);
+	return 0;
     }
     size_b1 = flash_get_size((vu_long *)FLASH_BASE1_PRELIM, &flash_info[1]);
     if (flash_info[1].flash_id == FLASH_UNKNOWN) {
-        printf ("## Unknown FLASH on Bank 1 - Size = 0x%08lx = %ld MB\n",
-            size_b1, size_b1<<20);
-        return 0;
+	printf ("## Unknown FLASH on Bank 1 - Size = 0x%08lx = %ld MB\n",
+	    size_b1, size_b1<<20);
+	return 0;
     }
 
     /* Calculate base addresses */
@@ -83,21 +83,21 @@
 
     /* Monitor protection ON by default */
     (void)flash_protect(FLAG_PROTECT_SET,
-                        base_b0 + size_b0 - monitor_flash_len,
-                        base_b0 + size_b0 - 1,
-                        &flash_info[0]);
+			base_b0 + size_b0 - monitor_flash_len,
+			base_b0 + size_b0 - 1,
+			&flash_info[0]);
 
     /* Protect the FPGA image */
     (void)flash_protect(FLAG_PROTECT_SET,
-                        FLASH_BASE1_PRELIM,
-                        FLASH_BASE1_PRELIM + CFG_FPGA_IMAGE_LEN - 1,
-                        &flash_info[1]);
+			FLASH_BASE1_PRELIM,
+			FLASH_BASE1_PRELIM + CFG_FPGA_IMAGE_LEN - 1,
+			&flash_info[1]);
 
     /* Protect the default boot image */
     (void)flash_protect(FLAG_PROTECT_SET,
-                        FLASH_BASE1_PRELIM + CFG_FPGA_IMAGE_LEN,
-                        FLASH_BASE1_PRELIM + CFG_FPGA_IMAGE_LEN + 0x600000 - 1,
-                        &flash_info[1]);
+			FLASH_BASE1_PRELIM + CFG_FPGA_IMAGE_LEN,
+			FLASH_BASE1_PRELIM + CFG_FPGA_IMAGE_LEN + 0x600000 - 1,
+			&flash_info[1]);
 
     /* Setup offsets for Main Flash */
     flash_get_offsets (FLASH_BASE1_PRELIM, &flash_info[1]);
@@ -113,8 +113,8 @@
 
     /* set up sector start address table - FOR BOOT ROM ONLY!!! */
     if ((info->flash_id & FLASH_TYPEMASK)  == FLASH_AM040) {
-        for (i = 0; i < info->sector_count; i++)
-            info->start[i] = base + (i * 0x00010000);
+	for (i = 0; i < info->sector_count; i++)
+	    info->start[i] = base + (i * 0x00010000);
     }
 } /* end flash_get_offsets() */
 
@@ -129,75 +129,75 @@
     volatile unsigned long *flash;
 
     if (info->flash_id == FLASH_UNKNOWN) {
-        printf ("missing or unknown FLASH type\n");
-        return;
+	printf ("missing or unknown FLASH type\n");
+	return;
     }
 
     switch (info->flash_id & FLASH_VENDMASK) {
-        case FLASH_MAN_AMD:     printf ("1 x AMD ");    break;
+	case FLASH_MAN_AMD:     printf ("1 x AMD ");    break;
 	case FLASH_MAN_STM:	printf ("1 x STM ");	break;
-        case FLASH_MAN_INTEL:   printf ("2 x Intel ");  break;
-        default:                printf ("Unknown Vendor ");
+	case FLASH_MAN_INTEL:   printf ("2 x Intel ");  break;
+	default:                printf ("Unknown Vendor ");
     }
 
     switch (info->flash_id & FLASH_TYPEMASK) {
-        case FLASH_AM040:
+	case FLASH_AM040:
 	    if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_AMD)
-            	printf ("AM29LV040 (4096 Kbit, uniform sector size)\n");
+		printf ("AM29LV040 (4096 Kbit, uniform sector size)\n");
 	    else if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_STM)
-            	printf ("M29W040B (4096 Kbit, uniform block size)\n");
+		printf ("M29W040B (4096 Kbit, uniform block size)\n");
 	    else
-            	printf ("UNKNOWN 29x040x (4096 Kbit, uniform sector size)\n");
-            break;
-        case FLASH_28F320J3A:
-            printf ("28F320J3A (32 Mbit = 128K x 32)\n");
-            break;
-        case FLASH_28F640J3A:
-            printf ("28F640J3A (64 Mbit = 128K x 64)\n");
-            break;
-        case FLASH_28F128J3A:
-            printf ("28F128J3A (128 Mbit = 128K x 128)\n");
-            break;
-        default:
-            printf ("Unknown Chip Type\n");
+		printf ("UNKNOWN 29x040x (4096 Kbit, uniform sector size)\n");
+	    break;
+	case FLASH_28F320J3A:
+	    printf ("28F320J3A (32 Mbit = 128K x 32)\n");
+	    break;
+	case FLASH_28F640J3A:
+	    printf ("28F640J3A (64 Mbit = 128K x 64)\n");
+	    break;
+	case FLASH_28F128J3A:
+	    printf ("28F128J3A (128 Mbit = 128K x 128)\n");
+	    break;
+	default:
+	    printf ("Unknown Chip Type\n");
     }
 
     if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_STM) {
-    	printf ("  Size: %ld KB in %d Blocks\n",
-        	info->size >> 10, info->sector_count);
+	printf ("  Size: %ld KB in %d Blocks\n",
+		info->size >> 10, info->sector_count);
     } else {
-    	printf ("  Size: %ld KB in %d Sectors\n",
-        	info->size >> 10, info->sector_count);
+	printf ("  Size: %ld KB in %d Sectors\n",
+		info->size >> 10, info->sector_count);
     }
 
     printf ("  Sector Start Addresses:");
     for (i=0; i<info->sector_count; ++i) {
-        /*
-         * Check if whole sector is erased
-         */
-        if (i != (info->sector_count-1))
-            size = info->start[i+1] - info->start[i];
-        else
-            size = info->start[0] + info->size - info->start[i];
-        erased = 1;
-        flash = (volatile unsigned long *)info->start[i];
-        size = size >> 2;        /* divide by 4 for longword access */
-        for (k=0; k<size; k++)
-        {
-            if (*flash++ != 0xffffffff)
-            {
-                erased = 0;
-                break;
-            }
-        }
+	/*
+	 * Check if whole sector is erased
+	 */
+	if (i != (info->sector_count-1))
+	    size = info->start[i+1] - info->start[i];
+	else
+	    size = info->start[0] + info->size - info->start[i];
+	erased = 1;
+	flash = (volatile unsigned long *)info->start[i];
+	size = size >> 2;        /* divide by 4 for longword access */
+	for (k=0; k<size; k++)
+	{
+	    if (*flash++ != 0xffffffff)
+	    {
+		erased = 0;
+		break;
+	    }
+	}
 
-        if ((i % 5) == 0)
-            printf ("\n   ");
-        printf (" %08lX%s%s",
-            info->start[i],
-            erased ? " E" : "  ",
-            info->protect[i] ? "RO " : "   "
-        );
+	if ((i % 5) == 0)
+	    printf ("\n   ");
+	printf (" %08lX%s%s",
+	    info->start[i],
+	    erased ? " E" : "  ",
+	    info->protect[i] ? "RO " : "   "
+	);
     }
     printf ("\n");
 } /* end flash_print_info() */
@@ -217,130 +217,130 @@
 
     /* Test for Boot Flash */
     if (base == FLASH_BASE0_PRELIM) {
-        unsigned char value;
-        volatile unsigned char * addr2 = (unsigned char *)addr;
+	unsigned char value;
+	volatile unsigned char * addr2 = (unsigned char *)addr;
 
-        /* Write auto select command: read Manufacturer ID */
-        *(addr2 + 0x555) = 0xaa;
-        *(addr2 + 0x2aa) = 0x55;
-        *(addr2 + 0x555) = 0x90;
+	/* Write auto select command: read Manufacturer ID */
+	*(addr2 + 0x555) = 0xaa;
+	*(addr2 + 0x2aa) = 0x55;
+	*(addr2 + 0x555) = 0x90;
 
-        /* Manufacture ID */
-        value = *addr2;
-        switch (value) {
-            case (unsigned char)AMD_MANUFACT:
-                info->flash_id = FLASH_MAN_AMD;
-                break;
+	/* Manufacture ID */
+	value = *addr2;
+	switch (value) {
+	    case (unsigned char)AMD_MANUFACT:
+		info->flash_id = FLASH_MAN_AMD;
+		break;
 	    case (unsigned char)STM_MANUFACT:
 		info->flash_id = FLASH_MAN_STM;
 		break;
-            default:
-                *addr2 = 0xf0;              /* no or unknown flash  */
-                return 0;
-        }
+	    default:
+		*addr2 = 0xf0;              /* no or unknown flash  */
+		return 0;
+	}
 
-        /* Device ID */
-        value = *(addr2 + 1);
-        switch (value) {
-            case (unsigned char)AMD_ID_LV040B:
+	/* Device ID */
+	value = *(addr2 + 1);
+	switch (value) {
+	    case (unsigned char)AMD_ID_LV040B:
 	    case (unsigned char)STM_ID_29W040B:
-                info->flash_id += FLASH_AM040;
-                info->sector_count = 8;
-                info->size = 0x00080000;
-                break;                       /* => 512Kb */
-            default:
-                *addr2 = 0xf0;               /* => no or unknown flash */
-                return 0;
-        }
+		info->flash_id += FLASH_AM040;
+		info->sector_count = 8;
+		info->size = 0x00080000;
+		break;                       /* => 512Kb */
+	    default:
+		*addr2 = 0xf0;               /* => no or unknown flash */
+		return 0;
+	}
     }
     else { /* MAIN Flash */
-        unsigned long value;
-        volatile unsigned long * addr2 = (unsigned long *)addr;
+	unsigned long value;
+	volatile unsigned long * addr2 = (unsigned long *)addr;
 
-        /* Write auto select command: read Manufacturer ID */
-        *addr2 = 0x90909090;
+	/* Write auto select command: read Manufacturer ID */
+	*addr2 = 0x90909090;
 
-        /* Manufacture ID */
-        value = *addr2;
-        switch (value) {
-            case (unsigned long)INTEL_MANUFACT:
-                info->flash_id = FLASH_MAN_INTEL;
-                break;
-            default:
-                *addr2 = 0xff;              /* no or unknown flash  */
-                return 0;
-        }
+	/* Manufacture ID */
+	value = *addr2;
+	switch (value) {
+	    case (unsigned long)INTEL_MANUFACT:
+		info->flash_id = FLASH_MAN_INTEL;
+		break;
+	    default:
+		*addr2 = 0xff;              /* no or unknown flash  */
+		return 0;
+	}
 
-        /* Device ID - This shit is interleaved... */
-        value = *(addr2 + 1);
-        switch (value) {
-            case (unsigned long)INTEL_ID_28F320J3A:
-                info->flash_id += FLASH_28F320J3A;
-                info->sector_count = 32;
-                info->size = 0x00400000 * 2;
-                break;                       /* => 2 X 4 MB */
-            case (unsigned long)INTEL_ID_28F640J3A:
-                info->flash_id += FLASH_28F640J3A;
-                info->sector_count = 64;
-                info->size = 0x00800000 * 2;
-                break;                       /* => 2 X 8 MB */
-            case (unsigned long)INTEL_ID_28F128J3A:
-                info->flash_id += FLASH_28F128J3A;
-                info->sector_count = 128;
-                info->size = 0x01000000 * 2;
-                break;                       /* => 2 X 16 MB */
-            default:
-                *addr2 = 0xff;               /* => no or unknown flash */
-        }
+	/* Device ID - This shit is interleaved... */
+	value = *(addr2 + 1);
+	switch (value) {
+	    case (unsigned long)INTEL_ID_28F320J3A:
+		info->flash_id += FLASH_28F320J3A;
+		info->sector_count = 32;
+		info->size = 0x00400000 * 2;
+		break;                       /* => 2 X 4 MB */
+	    case (unsigned long)INTEL_ID_28F640J3A:
+		info->flash_id += FLASH_28F640J3A;
+		info->sector_count = 64;
+		info->size = 0x00800000 * 2;
+		break;                       /* => 2 X 8 MB */
+	    case (unsigned long)INTEL_ID_28F128J3A:
+		info->flash_id += FLASH_28F128J3A;
+		info->sector_count = 128;
+		info->size = 0x01000000 * 2;
+		break;                       /* => 2 X 16 MB */
+	    default:
+		*addr2 = 0xff;               /* => no or unknown flash */
+	}
     }
 
     /* Make sure we don't exceed CFG_MAX_FLASH_SECT */
     if (info->sector_count > CFG_MAX_FLASH_SECT) {
-        printf ("** ERROR: sector count %d > max (%d) **\n",
-                info->sector_count, CFG_MAX_FLASH_SECT);
-        info->sector_count = CFG_MAX_FLASH_SECT;
+	printf ("** ERROR: sector count %d > max (%d) **\n",
+		info->sector_count, CFG_MAX_FLASH_SECT);
+	info->sector_count = CFG_MAX_FLASH_SECT;
     }
 
     /* set up sector start address table */
     switch (info->flash_id & FLASH_TYPEMASK) {
-        case FLASH_AM040:
-            for (i = 0; i < info->sector_count; i++)
-                info->start[i] = base + (i * 0x00010000);
-            break;
-        case FLASH_28F320J3A:
-        case FLASH_28F640J3A:
-        case FLASH_28F128J3A:
-            for (i = 0; i < info->sector_count; i++)
-                info->start[i] = base + (i * 0x00020000 * 2); /* 2 Banks */
-            break;
+	case FLASH_AM040:
+	    for (i = 0; i < info->sector_count; i++)
+		info->start[i] = base + (i * 0x00010000);
+	    break;
+	case FLASH_28F320J3A:
+	case FLASH_28F640J3A:
+	case FLASH_28F128J3A:
+	    for (i = 0; i < info->sector_count; i++)
+		info->start[i] = base + (i * 0x00020000 * 2); /* 2 Banks */
+	    break;
     }
 
     /* Test for Boot Flash */
     if (base == FLASH_BASE0_PRELIM) {
-        volatile unsigned char *addr2;
-        /* check for protected sectors */
-        for (i = 0; i < info->sector_count; i++) {
-            /* read sector protection at sector address, (AX .. A0) = 0x02 */
-            /* D0 = 1 if protected */
-            addr2 = (volatile unsigned char *)(info->start[i]);
-            info->protect[i] = *(addr2 + 2) & 1;
-        }
+	volatile unsigned char *addr2;
+	/* check for protected sectors */
+	for (i = 0; i < info->sector_count; i++) {
+	    /* read sector protection at sector address, (AX .. A0) = 0x02 */
+	    /* D0 = 1 if protected */
+	    addr2 = (volatile unsigned char *)(info->start[i]);
+	    info->protect[i] = *(addr2 + 2) & 1;
+	}
 
-        /* Restore read mode */
-        *(unsigned char *)base = 0xF0;       /* Reset NORMAL Flash */
+	/* Restore read mode */
+	*(unsigned char *)base = 0xF0;       /* Reset NORMAL Flash */
     }
     else { /* Main Flash */
-        volatile unsigned long *addr2;
-        /* check for protected sectors */
-        for (i = 0; i < info->sector_count; i++) {
-            /* read sector protection at sector address, (AX .. A0) = 0x02 */
-            /* D0 = 1 if protected */
-            addr2 = (volatile unsigned long *)(info->start[i]);
-            info->protect[i] = *(addr2 + 2) & 0x1;
-        }
+	volatile unsigned long *addr2;
+	/* check for protected sectors */
+	for (i = 0; i < info->sector_count; i++) {
+	    /* read sector protection at sector address, (AX .. A0) = 0x02 */
+	    /* D0 = 1 if protected */
+	    addr2 = (volatile unsigned long *)(info->start[i]);
+	    info->protect[i] = *(addr2 + 2) & 0x1;
+	}
 
-        /* Restore read mode */
-        *(unsigned long *)base = 0xFFFFFFFF; /* Reset  Flash */
+	/* Restore read mode */
+	*(unsigned long *)base = 0xFFFFFFFF; /* Reset  Flash */
     }
 
     return (info->size);
@@ -357,20 +357,20 @@
 
     /* Loop X times */
     for (i = 1; i <= (100 * tout); i++) {    /* Wait up to tout ms */
-        udelay(10);
-        /* Pause 10 us */
+	udelay(10);
+	/* Pause 10 us */
 
-        /* Check for completion */
-        if ((vaddr[0] & 0x80) == (cmp_val & 0x80)) {
-            return 0;
-        }
+	/* Check for completion */
+	if ((vaddr[0] & 0x80) == (cmp_val & 0x80)) {
+	    return 0;
+	}
 
-        /* KEEP THE LUSER HAPPY - Print a dot every 1.1 seconds */
-        if (!(i % 110000))
-            putc('.');
+	/* KEEP THE LUSER HAPPY - Print a dot every 1.1 seconds */
+	if (!(i % 110000))
+	    putc('.');
 
-        /* Kick the dog if needed */
-        WATCHDOG_RESET();
+	/* Kick the dog if needed */
+	WATCHDOG_RESET();
     }
 
     return 1;
@@ -388,70 +388,70 @@
 
     /* Validate arguments */
     if ((s_first < 0) || (s_first > s_last)) {
-        if (info->flash_id == FLASH_UNKNOWN)
-            printf ("- missing\n");
-        else
-            printf ("- no sectors to erase\n");
-        return 1;
+	if (info->flash_id == FLASH_UNKNOWN)
+	    printf ("- missing\n");
+	else
+	    printf ("- no sectors to erase\n");
+	return 1;
     }
 
     /* Check for KNOWN flash type */
     if (info->flash_id == FLASH_UNKNOWN) {
-        printf ("Can't erase unknown flash type - aborted\n");
-        return 1;
+	printf ("Can't erase unknown flash type - aborted\n");
+	return 1;
     }
 
     /* Check for protected sectors */
     prot = 0;
     for (sect = s_first; sect <= s_last; ++sect) {
-        if (info->protect[sect])
-            prot++;
+	if (info->protect[sect])
+	    prot++;
     }
     if (prot)
-        printf ("- Warning: %d protected sectors will not be erased!\n", prot);
+	printf ("- Warning: %d protected sectors will not be erased!\n", prot);
     else
-        printf ("\n");
+	printf ("\n");
 
     /* Start erase on unprotected sectors */
     for (sect = s_first; sect <= s_last; sect++) {
-        if (info->protect[sect] == 0) {      /* not protected */
-            sector_addr = (uchar *)(info->start[sect]);
+	if (info->protect[sect] == 0) {      /* not protected */
+	    sector_addr = (uchar *)(info->start[sect]);
 
-    		if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_STM)
+		if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_STM)
 		    printf("Erasing block %p\n", sector_addr);
 		else
 		    printf("Erasing sector %p\n", sector_addr);
 
-            /* Disable interrupts which might cause Flash to timeout */
-            flag = disable_interrupts();
+	    /* Disable interrupts which might cause Flash to timeout */
+	    flag = disable_interrupts();
 
-            *(addr + 0x555) = (uchar)0xAA;
-            *(addr + 0x2aa) = (uchar)0x55;
-            *(addr + 0x555) = (uchar)0x80;
-            *(addr + 0x555) = (uchar)0xAA;
-            *(addr + 0x2aa) = (uchar)0x55;
-            *sector_addr = (uchar)0x30;      /* sector erase */
+	    *(addr + 0x555) = (uchar)0xAA;
+	    *(addr + 0x2aa) = (uchar)0x55;
+	    *(addr + 0x555) = (uchar)0x80;
+	    *(addr + 0x555) = (uchar)0xAA;
+	    *(addr + 0x2aa) = (uchar)0x55;
+	    *sector_addr = (uchar)0x30;      /* sector erase */
 
-            /*
-             * Wait for each sector to complete, it's more
-             * reliable.  According to AMD Spec, you must
-             * issue all erase commands within a specified
-             * timeout.  This has been seen to fail, especially
-             * if printf()s are included (for debug)!!
-             * Takes up to 6 seconds.
-             */
-            tcode  = wait_for_DQ7((ulong)sector_addr, 0x80, 6000);
+	    /*
+	     * Wait for each sector to complete, it's more
+	     * reliable.  According to AMD Spec, you must
+	     * issue all erase commands within a specified
+	     * timeout.  This has been seen to fail, especially
+	     * if printf()s are included (for debug)!!
+	     * Takes up to 6 seconds.
+	     */
+	    tcode  = wait_for_DQ7((ulong)sector_addr, 0x80, 6000);
 
-            /* re-enable interrupts if necessary */
-            if (flag)
-                enable_interrupts();
+	    /* re-enable interrupts if necessary */
+	    if (flag)
+		enable_interrupts();
 
-            /* Make sure we didn't timeout */
-            if (tcode) {
-                printf ("Timeout\n");
-                rcode = 1;
-            }
-        }
+	    /* Make sure we didn't timeout */
+	    if (tcode) {
+		printf ("Timeout\n");
+		rcode = 1;
+	    }
+	}
     }
 
     /* wait at least 80us - let's wait 1 ms */
@@ -473,68 +473,68 @@
 
     /* Validate arguments */
     if ((s_first < 0) || (s_first > s_last)) {
-        if (info->flash_id == FLASH_UNKNOWN)
-            printf ("- missing\n");
-        else
-            printf ("- no sectors to erase\n");
-        return 1;
+	if (info->flash_id == FLASH_UNKNOWN)
+	    printf ("- missing\n");
+	else
+	    printf ("- no sectors to erase\n");
+	return 1;
     }
 
     /* Check for KNOWN flash type */
     if ((info->flash_id & FLASH_VENDMASK) != FLASH_MAN_INTEL) {
-        printf ("Can erase only Intel flash types - aborted\n");
-        return 1;
+	printf ("Can erase only Intel flash types - aborted\n");
+	return 1;
     }
 
     /* Check for protected sectors */
     for (sect = s_first; sect <= s_last; ++sect) {
-        if (info->protect[sect])
-            prot++;
+	if (info->protect[sect])
+	    prot++;
     }
     if (prot)
-        printf ("- Warning: %d protected sectors will not be erased!\n", prot);
+	printf ("- Warning: %d protected sectors will not be erased!\n", prot);
     else
-        printf ("\n");
+	printf ("\n");
 
     start = get_timer (0);
     last  = start;
     /* Start erase on unprotected sectors */
     for (sect = s_first; sect <= s_last; sect++) {
-        WATCHDOG_RESET();
-        if (info->protect[sect] == 0) {      /* not protected */
-            vu_long *addr = (vu_long *)(info->start[sect]);
-            unsigned long status;
+	WATCHDOG_RESET();
+	if (info->protect[sect] == 0) {      /* not protected */
+	    vu_long *addr = (vu_long *)(info->start[sect]);
+	    unsigned long status;
 
-            /* Disable interrupts which might cause a timeout here */
-            flag = disable_interrupts();
+	    /* Disable interrupts which might cause a timeout here */
+	    flag = disable_interrupts();
 
-            *addr = 0x00500050;              /* clear status register */
-            *addr = 0x00200020;              /* erase setup */
-            *addr = 0x00D000D0;              /* erase confirm */
+	    *addr = 0x00500050;              /* clear status register */
+	    *addr = 0x00200020;              /* erase setup */
+	    *addr = 0x00D000D0;              /* erase confirm */
 
-            /* re-enable interrupts if necessary */
-            if (flag)
-                enable_interrupts();
+	    /* re-enable interrupts if necessary */
+	    if (flag)
+		enable_interrupts();
 
-            /* Wait at least 80us - let's wait 1 ms */
-            udelay (1000);
+	    /* Wait at least 80us - let's wait 1 ms */
+	    udelay (1000);
 
-            while (((status = *addr) & 0x00800080) != 0x00800080) {
-                if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
-                    printf ("Timeout\n");
-                    *addr = 0x00B000B0;      /* suspend erase      */
-                    *addr = 0x00FF00FF;      /* reset to read mode */
-                    return 1;
-                }
+	    while (((status = *addr) & 0x00800080) != 0x00800080) {
+		if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
+		    printf ("Timeout\n");
+		    *addr = 0x00B000B0;      /* suspend erase      */
+		    *addr = 0x00FF00FF;      /* reset to read mode */
+		    return 1;
+		}
 
-                /* show that we're waiting */
-                if ((now - last) > 990) {   /* every second */
-                    putc ('.');
-                    last = now;
-                }
-            }
-            *addr = 0x00FF00FF;              /* reset to read mode */
-        }
+		/* show that we're waiting */
+		if ((now - last) > 990) {   /* every second */
+		    putc ('.');
+		    last = now;
+		}
+	    }
+	    *addr = 0x00FF00FF;              /* reset to read mode */
+	}
     }
     printf (" done\n");
     return 0;
@@ -543,9 +543,9 @@
 int flash_erase(flash_info_t *info, int s_first, int s_last)
 {
     if ((info->flash_id & FLASH_TYPEMASK) == FLASH_AM040)
-        return flash_erase8(info, s_first, s_last);
+	return flash_erase8(info, s_first, s_last);
     else
-        return flash_erase32(info, s_first, s_last);
+	return flash_erase32(info, s_first, s_last);
 } /* end flash_erase() */
 
 /*-----------------------------------------------------------------------
@@ -563,53 +563,53 @@
     start = get_timer (0);
 
     wp = (addr & ~3);                        /* get lower word
-                                                aligned address */
+						aligned address */
 
     /*
      * handle unaligned start bytes
      */
     if ((l = addr - wp) != 0) {
-        data = 0;
-        for (i=0, cp=wp; i<l; ++i, ++cp) {
-            data = (data << 8) | (*(uchar *)cp);
-        }
-        for (; i<4 && cnt>0; ++i) {
-            data = (data << 8) | *src++;
-            --cnt;
-            ++cp;
-        }
-        for (; cnt==0 && i<4; ++i, ++cp) {
-            data = (data << 8) | (*(uchar *)cp);
-        }
+	data = 0;
+	for (i=0, cp=wp; i<l; ++i, ++cp) {
+	    data = (data << 8) | (*(uchar *)cp);
+	}
+	for (; i<4 && cnt>0; ++i) {
+	    data = (data << 8) | *src++;
+	    --cnt;
+	    ++cp;
+	}
+	for (; cnt==0 && i<4; ++i, ++cp) {
+	    data = (data << 8) | (*(uchar *)cp);
+	}
 
-        if ((rc = write_word8(info, wp, data)) != 0) {
-            return (rc);
-        }
-        wp += 4;
+	if ((rc = write_word8(info, wp, data)) != 0) {
+	    return (rc);
+	}
+	wp += 4;
     }
 
     /*
      * handle word aligned part
      */
     while (cnt >= 4) {
-        data = 0;
-        for (i=0; i<4; ++i) {
-            data = (data << 8) | *src++;
-        }
-        if ((rc = write_word8(info, wp, data)) != 0) {
-            return (rc);
-        }
-        wp  += 4;
-        cnt -= 4;
-        if (get_timer(start) > 1000) {   /* every second */
-           WATCHDOG_RESET();
-           putc ('.');
-           start = get_timer(0);
-        }
+	data = 0;
+	for (i=0; i<4; ++i) {
+	    data = (data << 8) | *src++;
+	}
+	if ((rc = write_word8(info, wp, data)) != 0) {
+	    return (rc);
+	}
+	wp  += 4;
+	cnt -= 4;
+	if (get_timer(start) > 1000) {   /* every second */
+	   WATCHDOG_RESET();
+	   putc ('.');
+	   start = get_timer(0);
+	}
     }
 
     if (cnt == 0) {
-        return (0);
+	return (0);
     }
 
     /*
@@ -617,11 +617,11 @@
      */
     data = 0;
     for (i=0, cp=wp; i<4 && cnt>0; ++i, ++cp) {
-        data = (data << 8) | *src++;
-        --cnt;
+	data = (data << 8) | *src++;
+	--cnt;
     }
     for (; i<4; ++i, ++cp) {
-        data = (data << 8) | (*(uchar *)cp);
+	data = (data << 8) | (*(uchar *)cp);
     }
 
     return (write_word8(info, wp, data));
@@ -678,7 +678,7 @@
 		}
 		wp  += FLASH_WIDTH;
 		cnt -= FLASH_WIDTH;
-          if (get_timer(start) > 990) {   /* every second */
+	  if (get_timer(start) > 990) {   /* every second */
 			putc ('.');
 			start = get_timer(0);
 		}
@@ -708,9 +708,9 @@
     int retval;
 
     if ((info->flash_id & FLASH_TYPEMASK) == FLASH_AM040)
-        retval = write_buff8(info, src, addr, cnt);
+	retval = write_buff8(info, src, addr, cnt);
     else
-        retval = write_buff32(info, src, addr, cnt);
+	retval = write_buff32(info, src, addr, cnt);
 
     return retval;
 } /* end write_buff() */
@@ -732,31 +732,31 @@
 
     /* Check if Flash is (sufficently) erased */
     if ((*((volatile uchar *)dest) &
-        (uchar)data) != (uchar)data) {
-        return (2);
+	(uchar)data) != (uchar)data) {
+	return (2);
     }
 
     for (i=0; i < (4 / sizeof(uchar)); i++) {
-        /* Disable interrupts which might cause a timeout here */
-        flag = disable_interrupts();
+	/* Disable interrupts which might cause a timeout here */
+	flag = disable_interrupts();
 
-        *(addr2 + 0x555) = (uchar)0xAA;
-        *(addr2 + 0x2aa) = (uchar)0x55;
-        *(addr2 + 0x555) = (uchar)0xA0;
+	*(addr2 + 0x555) = (uchar)0xAA;
+	*(addr2 + 0x2aa) = (uchar)0x55;
+	*(addr2 + 0x555) = (uchar)0xA0;
 
-        dest2[i] = data2[i];
+	dest2[i] = data2[i];
 
-        /* Wait for write to complete, up to 1ms */
-        tcode = wait_for_DQ7((ulong)&dest2[i], data2[i], 1);
+	/* Wait for write to complete, up to 1ms */
+	tcode = wait_for_DQ7((ulong)&dest2[i], data2[i], 1);
 
-        /* re-enable interrupts if necessary */
-        if (flag)
-            enable_interrupts();
+	/* re-enable interrupts if necessary */
+	if (flag)
+	    enable_interrupts();
 
-        /* Make sure we didn't timeout */
-        if (tcode) {
-            rcode = 1;
-        }
+	/* Make sure we didn't timeout */
+	if (tcode) {
+	    rcode = 1;
+	}
     }
 
     return rcode;
@@ -771,7 +771,7 @@
 
     /* Check if Flash is (sufficiently) erased */
     if ((*addr & data) != data) {
-        return (2);
+	return (2);
     }
     /* Disable interrupts which might cause a timeout here */
     flag = disable_interrupts();
@@ -781,16 +781,16 @@
 
     /* re-enable interrupts if necessary */
     if (flag)
-        enable_interrupts();
+	enable_interrupts();
 
     start = get_timer (0);
 
     while (((status = *addr) & 0x00800080) != 0x00800080) {
-        WATCHDOG_RESET();
-        if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
-            *addr = 0x00FF00FF;              /* restore read mode */
-            return (1);
-        }
+	WATCHDOG_RESET();
+	if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
+	    *addr = 0x00FF00FF;              /* restore read mode */
+	    return (1);
+	}
     }
 
     *addr = 0x00FF00FF;                      /* restore read mode */
@@ -808,50 +808,50 @@
     volatile long *addr = (unsigned long *)sector;
 
     switch(info->flash_id & FLASH_TYPEMASK) {
-        case FLASH_28F320J3A:
-        case FLASH_28F640J3A:
-        case FLASH_28F128J3A:
-            /* Disable interrupts which might cause Flash to timeout */
-            flag = disable_interrupts();
+	case FLASH_28F320J3A:
+	case FLASH_28F640J3A:
+	case FLASH_28F128J3A:
+	    /* Disable interrupts which might cause Flash to timeout */
+	    flag = disable_interrupts();
 
-            /* Issue command */
-            *addr = 0x00500050L;             /* Clear the status register */
-            *addr = 0x00600060L;             /* Set lock bit setup */
-            *addr = 0x00010001L;             /* Set lock bit confirm */
+	    /* Issue command */
+	    *addr = 0x00500050L;             /* Clear the status register */
+	    *addr = 0x00600060L;             /* Set lock bit setup */
+	    *addr = 0x00010001L;             /* Set lock bit confirm */
 
-            /* Wait for command completion */
-            for (i = 0; i < 10; i++) {       /* 75us timeout, wait 100us */
-                udelay(10);
-                if ((*addr & 0x00800080L) == 0x00800080L)
-                    break;
-            }
+	    /* Wait for command completion */
+	    for (i = 0; i < 10; i++) {       /* 75us timeout, wait 100us */
+		udelay(10);
+		if ((*addr & 0x00800080L) == 0x00800080L)
+		    break;
+	    }
 
-            /* Not successful? */
-            status = *addr;
-            if (status != 0x00800080L) {
-                printf("Protect %x sector failed: %x\n",
-                       (uint)sector, (uint)status);
-                rcode = 1;
-            }
+	    /* Not successful? */
+	    status = *addr;
+	    if (status != 0x00800080L) {
+		printf("Protect %x sector failed: %x\n",
+		       (uint)sector, (uint)status);
+		rcode = 1;
+	    }
 
-            /* Restore read mode */
-            *addr = 0x00ff00ffL;
+	    /* Restore read mode */
+	    *addr = 0x00ff00ffL;
 
-            /* re-enable interrupts if necessary */
-            if (flag)
-                enable_interrupts();
+	    /* re-enable interrupts if necessary */
+	    if (flag)
+		enable_interrupts();
 
-            break;
-        case FLASH_AM040:                    /* No soft sector protection */
-            break;
+	    break;
+	case FLASH_AM040:                    /* No soft sector protection */
+	    break;
     }
 
     /* Turn protection on for this sector */
     for (i = 0; i < info->sector_count; i++) {
-        if (info->start[i] == sector) {
-            info->protect[i] = 1;
-            break;
-        }
+	if (info->start[i] == sector) {
+	    info->protect[i] = 1;
+	    break;
+	}
     }
 
     return rcode;
@@ -866,42 +866,42 @@
     volatile long *addr = (unsigned long *)sector;
 
     switch(info->flash_id & FLASH_TYPEMASK) {
-        case FLASH_28F320J3A:
-        case FLASH_28F640J3A:
-        case FLASH_28F128J3A:
-            /* Disable interrupts which might cause Flash to timeout */
-            flag = disable_interrupts();
+	case FLASH_28F320J3A:
+	case FLASH_28F640J3A:
+	case FLASH_28F128J3A:
+	    /* Disable interrupts which might cause Flash to timeout */
+	    flag = disable_interrupts();
 
-            *addr = 0x00500050L;             /* Clear the status register */
-            *addr = 0x00600060L;             /* Clear lock bit setup */
-            *addr = 0x00D000D0L;             /* Clear lock bit confirm */
+	    *addr = 0x00500050L;             /* Clear the status register */
+	    *addr = 0x00600060L;             /* Clear lock bit setup */
+	    *addr = 0x00D000D0L;             /* Clear lock bit confirm */
 
-            /* Wait for command completion */
-            for (i = 0; i < 80 ; i++) {      /* 700ms timeout, wait 800 */
-                udelay(10000);               /* Delay 10ms */
-                if ((*addr & 0x00800080L) == 0x00800080L)
-                    break;
-            }
+	    /* Wait for command completion */
+	    for (i = 0; i < 80 ; i++) {      /* 700ms timeout, wait 800 */
+		udelay(10000);               /* Delay 10ms */
+		if ((*addr & 0x00800080L) == 0x00800080L)
+		    break;
+	    }
 
-            /* Not successful? */
-            status = *addr;
-            if (status != 0x00800080L) {
-                printf("Un-protect %x sector failed: %x\n",
-                       (uint)sector, (uint)status);
-                *addr = 0x00ff00ffL;
-                rcode = 1;
-            }
+	    /* Not successful? */
+	    status = *addr;
+	    if (status != 0x00800080L) {
+		printf("Un-protect %x sector failed: %x\n",
+		       (uint)sector, (uint)status);
+		*addr = 0x00ff00ffL;
+		rcode = 1;
+	    }
 
-            /* restore read mode */
-            *addr = 0x00ff00ffL;
+	    /* restore read mode */
+	    *addr = 0x00ff00ffL;
 
-            /* re-enable interrupts if necessary */
-            if (flag)
-                enable_interrupts();
+	    /* re-enable interrupts if necessary */
+	    if (flag)
+		enable_interrupts();
 
-            break;
-        case FLASH_AM040:                    /* No soft sector protection */
-            break;
+	    break;
+	case FLASH_AM040:                    /* No soft sector protection */
+	    break;
     }
 
     /*
@@ -910,14 +910,14 @@
      * protection on a specific sector.
      */
     for (i = 0; i < info->sector_count; i++) {
-        if (info->start[i] != sector) {
-            if (info->protect[i]) {
-                if (_flash_protect(info, info->start[i]))
-                    rcode = 1;
+	if (info->start[i] != sector) {
+	    if (info->protect[i]) {
+		if (_flash_protect(info, info->start[i]))
+		    rcode = 1;
 	    }
-        }
-        else /* Turn protection off for this sector */
-            info->protect[i] = 0;
+	}
+	else /* Turn protection off for this sector */
+	    info->protect[i] = 0;
     }
 
     return rcode;
@@ -929,13 +929,12 @@
     int rcode;
 
     if (prot)
-        rcode = _flash_protect(info, info->start[sector]);
+	rcode = _flash_protect(info, info->start[sector]);
     else
-        rcode = _flash_unprotect(info, info->start[sector]);
+	rcode = _flash_unprotect(info, info->start[sector]);
 
     return rcode;
 } /* end flash_real_protect() */
 
 /*-----------------------------------------------------------------------
  */
-
diff --git a/board/w7o/fpga.c b/board/w7o/fpga.c
index e84123b..97af924 100644
--- a/board/w7o/fpga.c
+++ b/board/w7o/fpga.c
@@ -36,11 +36,11 @@
     volatile unsigned short *dest = daddr;	/* volatile-bypass optimizer */
 
     for (i = 0; i < len; i++, src++) {
-        val = *src;
-        *dest = (unsigned short)((val & 0xff000000L) >> 16);
-        *dest = (unsigned short)((val & 0x00ff0000L) >> 8);
-        *dest = (unsigned short)(val & 0x0000ff00L);
-        *dest = (unsigned short)((val & 0x000000ffL) << 8);
+	val = *src;
+	*dest = (unsigned short)((val & 0xff000000L) >> 16);
+	*dest = (unsigned short)((val & 0x00ff0000L) >> 8);
+	*dest = (unsigned short)(val & 0x0000ff00L);
+	*dest = (unsigned short)((val & 0x000000ffL) << 8);
     }
 
     /* Terminate programming with 4 C clocks */
@@ -88,14 +88,14 @@
 
     /* Wait for FPGA init line */
     while(in32(IBM405GP_GPIO0_IR) & GPIO_XCV_INIT) { /* Wait INIT line low */
-        /* Check for timeout - 100us max, so use 3ms */
-        if (get_timer(start) > 3) {
-            printf("     failed to start init.\n");
-            log_warn(ERR_XINIT0);		/* Don't halt */
+	/* Check for timeout - 100us max, so use 3ms */
+	if (get_timer(start) > 3) {
+	    printf("     failed to start init.\n");
+	    log_warn(ERR_XINIT0);		/* Don't halt */
 
-            /* Reset line stays low */
-            goto done;				/* I like gotos... */
-        }
+	    /* Reset line stays low */
+	    goto done;				/* I like gotos... */
+	}
     }
 
     /* Unreset FPGA */
@@ -105,75 +105,75 @@
     /* Wait for FPGA end of init period .  */
     while(!(in32(IBM405GP_GPIO0_IR) & GPIO_XCV_INIT)) { /* Wait for INIT hi */
 
-        /* Check for timeout */
-        if (get_timer(start) > 3) {
-            printf("     failed to exit init.\n");
-            log_warn(ERR_XINIT1);
+	/* Check for timeout */
+	if (get_timer(start) > 3) {
+	    printf("     failed to exit init.\n");
+	    log_warn(ERR_XINIT1);
 
-            /* Reset FPGA */
-            grego &= ~GPIO_XCV_PROG;		/* PROG line low */
-            out32(IBM405GP_GPIO0_OR, grego);
+	    /* Reset FPGA */
+	    grego &= ~GPIO_XCV_PROG;		/* PROG line low */
+	    out32(IBM405GP_GPIO0_OR, grego);
 
-            goto done;
-        }
+	    goto done;
+	}
     }
 
     /* Now program FPGA ... */
     ndest = dest;
     for (i = 0; i < CONFIG_NUM_FPGAS; i++) {
-        /* Toggle IRQ/GPIO */
-        greg = mfdcr(CPC0_CR0);			/* get chip ctrl register */
-        greg |= eirq;				/* toggle irq/gpio */
-        mtdcr(CPC0_CR0, greg);			/*  ... just do it */
+	/* Toggle IRQ/GPIO */
+	greg = mfdcr(CPC0_CR0);			/* get chip ctrl register */
+	greg |= eirq;				/* toggle irq/gpio */
+	mtdcr(CPC0_CR0, greg);			/*  ... just do it */
 
-        /* turn on open drain for CNFG */
-        greg = in32(IBM405GP_GPIO0_ODR);	/* get open drain register */
-        greg |= cnfg;				/* CNFG open drain */
-        out32(IBM405GP_GPIO0_ODR, greg);	/*  .. just do it */
+	/* turn on open drain for CNFG */
+	greg = in32(IBM405GP_GPIO0_ODR);	/* get open drain register */
+	greg |= cnfg;				/* CNFG open drain */
+	out32(IBM405GP_GPIO0_ODR, greg);	/*  .. just do it */
 
-        /* Turn output enable on for CNFG */
-        greg = in32(IBM405GP_GPIO0_TCR);	/* get tristate register */
-        greg |= cnfg;				/* CNFG tristate inactive */
-        out32(IBM405GP_GPIO0_TCR, greg);	/*  ... just do it */
+	/* Turn output enable on for CNFG */
+	greg = in32(IBM405GP_GPIO0_TCR);	/* get tristate register */
+	greg |= cnfg;				/* CNFG tristate inactive */
+	out32(IBM405GP_GPIO0_TCR, greg);	/*  ... just do it */
 
-        /* Setup FPGA for programming */
-        grego &= ~cnfg;				/* CONFIG line low */
-        out32(IBM405GP_GPIO0_OR, grego);
+	/* Setup FPGA for programming */
+	grego &= ~cnfg;				/* CONFIG line low */
+	out32(IBM405GP_GPIO0_OR, grego);
 
-        /*
-         * Program the FPGA
-         */
-        printf("\n       destination: 0x%lx ", (unsigned long)ndest);
+	/*
+	 * Program the FPGA
+	 */
+	printf("\n       destination: 0x%lx ", (unsigned long)ndest);
 
-        fpga_img_write(source,  length,  (unsigned short *)ndest);
+	fpga_img_write(source,  length,  (unsigned short *)ndest);
 
-        /* Done programming */
-        grego |= cnfg;				/* CONFIG line high */
-        out32(IBM405GP_GPIO0_OR, grego);
+	/* Done programming */
+	grego |= cnfg;				/* CONFIG line high */
+	out32(IBM405GP_GPIO0_OR, grego);
 
-        /* Turn output enable OFF for CNFG */
-        greg = in32(IBM405GP_GPIO0_TCR);	/* get tristate register */
-        greg &= ~cnfg;				/* CNFG tristate inactive */
-        out32(IBM405GP_GPIO0_TCR, greg);	/*  ... just do it */
+	/* Turn output enable OFF for CNFG */
+	greg = in32(IBM405GP_GPIO0_TCR);	/* get tristate register */
+	greg &= ~cnfg;				/* CNFG tristate inactive */
+	out32(IBM405GP_GPIO0_TCR, greg);	/*  ... just do it */
 
-        /* Toggle IRQ/GPIO */
-        greg = mfdcr(CPC0_CR0);			/* get chip ctrl register */
-        greg &= ~eirq;				/* toggle irq/gpio */
-        mtdcr(CPC0_CR0, greg);			/*  ... just do it */
+	/* Toggle IRQ/GPIO */
+	greg = mfdcr(CPC0_CR0);			/* get chip ctrl register */
+	greg &= ~eirq;				/* toggle irq/gpio */
+	mtdcr(CPC0_CR0, greg);			/*  ... just do it */
 
-        ndest = (unsigned short *)((char *)ndest + 0x00100000L); /* XXX - Next FPGA addr */
-        cnfg >>= 1;				/* XXX - Next  */
-        eirq >>= 1;
+	ndest = (unsigned short *)((char *)ndest + 0x00100000L); /* XXX - Next FPGA addr */
+	cnfg >>= 1;				/* XXX - Next  */
+	eirq >>= 1;
     }
 
     /* Terminate programming with 4 C clocks */
     ndest = dest;
     for (i = 0; i < CONFIG_NUM_FPGAS; i++) {
-        val = *ndest;
-        val = *ndest;
-        val = *ndest;
-        val = *ndest;
-        ndest = (unsigned short *)((char *)ndest + 0x00100000L);
+	val = *ndest;
+	val = *ndest;
+	val = *ndest;
+	val = *ndest;
+	ndest = (unsigned short *)((char *)ndest + 0x00100000L);
     }
 
     /* Setup timer */
@@ -182,17 +182,17 @@
     /* Wait for FPGA end of programming period .  */
     while(!(in32(IBM405GP_GPIO0_IR) & GPIO_XCV_DONE)) { /* Test DONE low */
 
-        /* Check for timeout */
-        if (get_timer(start) > 3) {
-            printf("     done failed to come high.\n");
-            log_warn(ERR_XDONE1);
+	/* Check for timeout */
+	if (get_timer(start) > 3) {
+	    printf("     done failed to come high.\n");
+	    log_warn(ERR_XDONE1);
 
-            /* Reset FPGA */
-            grego &= ~GPIO_XCV_PROG;		/* PROG line low */
-            out32(IBM405GP_GPIO0_OR, grego);
+	    /* Reset FPGA */
+	    grego &= ~GPIO_XCV_PROG;		/* PROG line low */
+	    out32(IBM405GP_GPIO0_OR, grego);
 
-            goto done;
-        }
+	    goto done;
+	}
     }
 
     printf("\n       FPGA load succeeded\n");
@@ -236,7 +236,7 @@
 
     /* Pedantic */
     if ((len < 0x133A4) || (len > 0x80000))
-        goto bad_image;
+	goto bad_image;
 
     /*
      * Get the file name pointer and length.
@@ -260,16 +260,16 @@
      */
     calc_crc = crc32(0, xcv_buf, xcv_len);
     if (crc != calc_crc) {
-        printf("\nfailed - bad CRC\n");
-        goto done;
+	printf("\nfailed - bad CRC\n");
+	goto done;
     }
 
     /* Output the file name */
     printf("file name  : ");
     for (i=0;i<fn_len;i++) {
-        bufchar = fn_buf[+i];
-        if (bufchar<' ' || bufchar>'~') bufchar = '.';
-        putc(bufchar);
+	bufchar = fn_buf[+i];
+	if (bufchar<' ' || bufchar>'~') bufchar = '.';
+	putc(bufchar);
     }
 
     /*
@@ -326,7 +326,7 @@
      * Program the FPGA.
      */
     retval = fpgaDownload((unsigned char*)xcv_buf, xcv_len,
-                          (unsigned short *)0xfd000000L);
+			  (unsigned short *)0xfd000000L);
     return retval;
 
 bad_image:
@@ -377,4 +377,3 @@
     printf("       FPGA ready\n");
     return;
 }
-
diff --git a/board/w7o/fsboot.c b/board/w7o/fsboot.c
index 800583d..0ef9a61 100644
--- a/board/w7o/fsboot.c
+++ b/board/w7o/fsboot.c
@@ -24,11 +24,12 @@
 #include <common.h>
 #include <config.h>
 #include <command.h>
-#include <cmd_elf.h>
 
 /*
  * FIXME: Add code to test image and it's header.
  */
+extern int valid_elf_image (unsigned long addr);
+
 static int
 image_check(ulong addr)
 {
@@ -87,4 +88,3 @@
 
     return;
 }
-
diff --git a/board/w7o/init.S b/board/w7o/init.S
index 511a1bb..35d7dbc 100644
--- a/board/w7o/init.S
+++ b/board/w7o/init.S
@@ -262,4 +262,3 @@
 	blr				/* Return to calling function */
 .Lfe1:	.size	sdram_init,.Lfe1-sdram_init
 /* end sdram_init() */
-
diff --git a/board/w7o/post1.S b/board/w7o/post1.S
index d510cca..21d206e 100644
--- a/board/w7o/post1.S
+++ b/board/w7o/post1.S
@@ -282,7 +282,7 @@
 	addi	r31, 0, 0x00ff		/* r31 = one byte of set bits */
 	stb     r31,0(r28)		/* save ff in referance address */
 
-        /* ghost (inner) loop, now check all posible ghosted addresses */
+	/* ghost (inner) loop, now check all posible ghosted addresses */
 	addi	r29, 0, 0		/* start ghosted loop counter at 0 */
 inside:
 	/*
@@ -323,11 +323,11 @@
 	addi	r3, 0, ERR_ADDF		/* get indexed error message */
 	bl	log_err			/* log error led error code */
 gb_done: /*  pack your bags, and go home */
-        lmw     r25, 8(r1)              /* restore r25 - r31 from stack */
-        lwz     r0, +40(r1)             /* Get saved link register */
-        addi    r1, r1, +36             /* Remove frame from stack */
-        mtlr    r0                      /* Restore link register */
-        blr                             /* Return to calling function */
+	lmw     r25, 8(r1)              /* restore r25 - r31 from stack */
+	lwz     r0, +40(r1)             /* Get saved link register */
+	addi    r1, r1, +36             /* Remove frame from stack */
+	mtlr    r0                      /* Restore link register */
+	blr                             /* Return to calling function */
 
 /****************************************************
  ********      SDRAM data fill tests       **********
@@ -373,7 +373,6 @@
 	blr				/* Return to calling function */
 
 
-
 /****************************************************
  ********             fill test              ********
  ***************************************************/
@@ -382,12 +381,12 @@
 /*	r4 = Value to write */
 /*	r3 = Error code */
 fill_test:
-        mflr    r0                      /* Get link register */
-        stwu    r1, -32(r1)             /* Save back chain and move SP */
-        stw     r0, +36(r1)             /* Save link register */
-        stmw    r27, 8(r1)              /* save r27 - r31 on stack */
-                                        /* r31 - scratch register */
-                                        /* r30 - memory address */
+	mflr    r0                      /* Get link register */
+	stwu    r1, -32(r1)             /* Save back chain and move SP */
+	stw     r0, +36(r1)             /* Save link register */
+	stmw    r27, 8(r1)              /* save r27 - r31 on stack */
+					/* r31 - scratch register */
+					/* r30 - memory address */
 	mr	r27, r3
 	mr	r28, r4
 	mr	r29, r5
@@ -412,8 +411,8 @@
 	mtctr	r31			/* setup counter */
 	addi	r30, 0, 0		/* Make r30 = addr 0 */
 ft_1:	lwz	r31, 0(r30)		/* get value from memory */
-        xor.	r31, r31, r28		/* Writen = Read ? */
-        bne	ft_err			/* If bad, than halt */
+	xor.	r31, r31, r28		/* Writen = Read ? */
+	bne	ft_err			/* If bad, than halt */
 	addi	r30, r30, 4		/* Increment to next word */
 	andi.	r31, r30, 0xffff	/* check for 2^16 loops*/
 	bne	ft_1a			/* if not there, then skip */
@@ -431,11 +430,11 @@
 	bl	log_err			/* output led err code, halt CPU */
 
 fill_done:
-        lmw     r27, 8(r1)              /* restore r27 - r31 from stack */
-        lwz     r0, +36(r1)             /* Get saved link register */
-        addi    r1, r1, +32             /* Remove frame from stack */
-        mtlr    r0                      /* Restore link register */
-        blr                             /* Return to calling function */
+	lmw     r27, 8(r1)              /* restore r27 - r31 from stack */
+	lwz     r0, +36(r1)             /* Get saved link register */
+	addi    r1, r1, +32             /* Remove frame from stack */
+	mtlr    r0                      /* Restore link register */
+	blr                             /* Return to calling function */
 
 
 /****************************************************
@@ -563,7 +562,7 @@
 	mtctr	r3
 log_2:
 	WATCHDOG_RESET			/* this keeps dog from barking, */
-				     	/*   and takes time */
+					/*   and takes time */
 	bdnz	log_2			/* loop till time expires */
 
 	/* restore stack and return */
@@ -585,27 +584,27 @@
 	stwu	r1, -8(r1)		/* Save back chain and move SP */
 	stw	r0, +12(r1)		/* Save link register */
 
-        addis   r3, 0, 0xef60
-        ori     r3, r3, 0x0303          /* r3 = UART0_LCR */
-        addi    r4, 0, 0x83             /* n81 format, divisor regs enabled */
-        stb     r4, 0(r3)
+	addis   r3, 0, 0xef60
+	ori     r3, r3, 0x0303          /* r3 = UART0_LCR */
+	addi    r4, 0, 0x83             /* n81 format, divisor regs enabled */
+	stb     r4, 0(r3)
 
 	/* set baud rate to use internal clock,
 	   baud = (200e6/16)/31/42 = 9600 */
 
-        addis   r3, 0, 0xef60		/* Address of baud divisor reg */
-        ori     r3, r3, 0x0300		/*   UART0_DLM */
-        addi    r4, 0, +42		/* uart baud divisor LSB = 93 */
-        stb     r4, 0(r3)               /* baud = (200 /16)/14/93 */
+	addis   r3, 0, 0xef60		/* Address of baud divisor reg */
+	ori     r3, r3, 0x0300		/*   UART0_DLM */
+	addi    r4, 0, +42		/* uart baud divisor LSB = 93 */
+	stb     r4, 0(r3)               /* baud = (200 /16)/14/93 */
 
-        addi    r3, r3, 0x0001		/* uart baud divisor addr */
-        addi    r4, 0, 0
-        stb     r4, 0(r3)               /* Divisor Latch MSB = 0 */
+	addi    r3, r3, 0x0001		/* uart baud divisor addr */
+	addi    r4, 0, 0
+	stb     r4, 0(r3)               /* Divisor Latch MSB = 0 */
 
-        addis   r3, 0, 0xef60
-        ori     r3, r3, 0x0303          /* r3 = UART0_LCR */
-        addi    r4, 0, 0x03             /* n81 format, tx/rx regs enabled */
-        stb     r4, 0(r3)
+	addis   r3, 0, 0xef60
+	ori     r3, r3, 0x0303          /* r3 = UART0_LCR */
+	addi    r4, 0, 0x03             /* n81 format, tx/rx regs enabled */
+	stb     r4, 0(r3)
 
 	/* output a few line feeds */
 	addi	r3, 0, '\n'		/* load line feed */
@@ -613,7 +612,7 @@
 	addi	r3, 0, '\n'		/* load line feed */
 	bl 	post_putc		/* output the char */
 
-        /* restore stack and return */
+	/* restore stack and return */
 	lwz	r0, +12(r1)		/* Get saved link register */
 	mtlr	r0			/* Restore link register */
 	addi	r1, r1, +8		/* Remove frame from stack */
@@ -633,7 +632,7 @@
 	stw	r0, +24(r1)		/* Save link register */
 	stmw	r29, 8(r1)		/* save	r29 - r31 on stack
 					   r31 - uart base address
-       					   r30 - delay counter
+					   r30 - delay counter
 					   r29 - scratch reg */
 
      addis   r31, 0, 0xef60		/* Point to uart base */
@@ -687,7 +686,7 @@
 	b	pputs_end		/* were outa here */
 pputs_term:
 	addi 	r3, 0, 1		/* set success code */
- 	/* restore stack and return */
+	/* restore stack and return */
 pputs_end:
 	lwz	r31, 8(r1)		/* restore r27 - r31 from stack */
 	lwz	r0, +16(r1)		/* Get saved link register */
@@ -696,7 +695,6 @@
 	blr				/* Return to calling function */
 
 
-
 /********************************************************************
  *****	disp_hex
  *****	Routine to display a hex value from a register.
@@ -736,10 +734,9 @@
 pputh_err:
 	addi 	r3, 0, -1 		/* set error code */
 pputh_done:
-        /* restore stack and return */
+	/* restore stack and return */
 	lmw	r30, 8(r1)		/*  restore r30 - r31 from stack */
 	lwz	r0, +20(r1)		/* Get saved link register */
 	addi	r1, r1, +16		/* Remove frame from stack */
 	mtlr	r0			/* Restore link register */
 	blr				/* Return to calling function */
-
diff --git a/board/w7o/post2.c b/board/w7o/post2.c
index 271c197..e590128 100644
--- a/board/w7o/post2.c
+++ b/board/w7o/post2.c
@@ -106,4 +106,3 @@
     if(dtt_test(4) != 0) log_warn(ERR_Ttest1);
 #endif /* CONFIG_DTT_LM75 */
 } /* post2() */
-
diff --git a/board/w7o/u-boot.lds b/board/w7o/u-boot.lds
index 4c753fc..5576ab9 100644
--- a/board/w7o/u-boot.lds
+++ b/board/w7o/u-boot.lds
@@ -103,6 +103,11 @@
   _edata  =  .;
   PROVIDE (edata = .);
 
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
   __start___ex_table = .;
   __ex_table : { *(__ex_table) }
   __stop___ex_table = .;
diff --git a/board/w7o/u-boot.lds.debug b/board/w7o/u-boot.lds.debug
index 6f65aa5..f996db3 100644
--- a/board/w7o/u-boot.lds.debug
+++ b/board/w7o/u-boot.lds.debug
@@ -106,6 +106,11 @@
   _edata  =  .;
   PROVIDE (edata = .);
 
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
   __start___ex_table = .;
   __ex_table : { *(__ex_table) }
   __stop___ex_table = .;
@@ -128,4 +133,3 @@
   _end = . ;
   PROVIDE (end = .);
 }
-
diff --git a/board/w7o/vpd.c b/board/w7o/vpd.c
index c24b127..fc2cd983 100644
--- a/board/w7o/vpd.c
+++ b/board/w7o/vpd.c
@@ -405,4 +405,3 @@
 	printf(dsfmt, sp, "WE Data Width",  vpdInfo->flashCfg.weDataWidth);
     }
 } /* vpd_print() */
-
diff --git a/board/w7o/vpd.h b/board/w7o/vpd.h
index 35bbe3e..1b71c8d 100644
--- a/board/w7o/vpd.h
+++ b/board/w7o/vpd.h
@@ -93,7 +93,7 @@
 
 
 #define VPD_DATA_SIZE (VPD_MAX_EEPROM_SIZE - SDRAM_SPD_DATA_SIZE - \
-                        sizeof(vpd_header_t))
+			sizeof(vpd_header_t))
 typedef struct vpd_s {
     vpd_header_t header;
     unsigned char packets[VPD_DATA_SIZE];
@@ -132,4 +132,3 @@
 extern void vpd_print(VPD *vpdInfo);
 
 #endif /* _VPD_H_ */
-
diff --git a/board/w7o/w7o.c b/board/w7o/w7o.c
index b404d61..bb52236 100644
--- a/board/w7o/w7o.c
+++ b/board/w7o/w7o.c
@@ -22,6 +22,7 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include "w7o.h"
 #include <asm/processor.h>
 
@@ -268,4 +269,3 @@
 
 	return (0);
 }
-
diff --git a/board/w7o/w7o.h b/board/w7o/w7o.h
index f0af2d6..8458166 100644
--- a/board/w7o/w7o.h
+++ b/board/w7o/w7o.h
@@ -90,4 +90,3 @@
 extern void init_fsboot(void);
 
 #endif /* _W7O_H_ */
-
diff --git a/board/w7o/watchdog.c b/board/w7o/watchdog.c
index 3fca5d3..4bbd94f 100644
--- a/board/w7o/watchdog.c
+++ b/board/w7o/watchdog.c
@@ -45,4 +45,3 @@
 } /* hw_watchdog_reset() */
 
 #endif /* CONFIG_HW_WATCHDOG */
-
